home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_10
/
1010042b
< prev
next >
Wrap
Text File
|
1992-08-08
|
733b
|
29 lines
Listing 2.
typedef struct { int DelFrom , DelThru } DelTyp;
#define DelsMax 20
DelTyp Dels [ DelsMax ];
DelTyp * DelPtr = Dels;
DelTyp * DelMaxPtr = Dels + DelsMax;
BOOL CheckDeleted
( ItemNo )
int ItemNo;
{ if ( DelPtr < DelMaxPtr
/* There is a deletion */
&& DelPtr -> DelFrom >= ItemNo )
/* and it applies to ItemNo */
{ assert ( ItemNo <= DelPtr -> DelThru )
/* We didn't slip past this deletion. */
if ( ItemNo == DelPtr -> DelThru )
/* ItemNo is the last covered
by the deletion */
DelPtr ++;
/* Consume the deletion. */
return TRUE;
}
else return FALSE;
}